package com.enbatis.mybatisplugs.toolkit;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class LocationUtil {
    public static String getAdressDetail(double lng,double lat) {
        Map<String,String> map = new HashMap<>();
        map.put("ak","t6v7gPZ8DT2KzqwtceFZaGYLoCYle52p");
        map.put("output","json");
        map.put("coordtype","wgs84ll");
        map.put("referer","119.165.137.87");
        map.put("location",lat+","+lat);
        JSONObject address=   HttpRequestUtils.httpPost("http://api.map.baidu.com/reverse_geocoding/v3/",map);
      String add=  address.toJSONString();
      return add;
    }


    /**
     * 产生一个32位的GUID
     * @return
     */
    public static String newGUID(){
        UUID uuid = UUID.randomUUID();
        return uuid.toString();
    }

    public static void main(String[] args) {
       String aaa= getAdressDetail(36.313663,120.428696);
       System.out.println(aaa);
    }

}
